<%@ page language="java" contentType="text/html; charset=UTF-8" pageEncoding="UTF-8" isELIgnored ="false"%>
<%@ taglib prefix="s" uri="/struts-tags" %>
<%
	String path = request.getContextPath();
%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN" "http://www.w3.org/TR/html4/strict.dtd">
<html>
	<head>
		<title>北京市电子行政监察平台-元数据管理</title>
		<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />
		<link href="<%=path%>/css/base.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/style.css" rel="stylesheet" type="text/css" />
		<link href="<%=path%>/css/frame.css" rel="stylesheet" type="text/css" />
		<script type="text/javascript">
			var path = "<%=path%>";
		</script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery-1.6.1.min.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery-jtemplates.pack.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/core/jquery.history.pack.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/config/client-config.js"></script>
		<script type="text/javascript">
			//载入配置
			loadConfigQueue(["metadata-config.js"]);
		</script>
		<script type="text/javascript" src="<%=path%>/javascript/system/client-history.js"></script>
		<script type="text/javascript">
		 	//载入历史记录脚本
			loadHistoryScriptQueue(["table-history.js"]);
		</script>
		<script type="text/javascript" src="<%=path%>/javascript/system/util.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/oacore.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/table.js"></script>
		<script type="text/javascript" src="<%=path%>/javascript/system/init.js"></script>
		<script type="text/javascript">
			//把创建表格方法引用赋给历史记录
			setTableCreator(function () {
				return new oacore.UI.Table({
					action: ACTIONS.METADATA.TABLE_LIST,
					requestPageParams:"dataSourceInfoId="+'${dataSourceInfoId}',
					tableUI: "table/metadata/table_list",
					parent: $("#dataTable"),
					advProxy: advSearchProxy,
					pageProxy: setPageProxy,
					sortProxy: sortProxy
				});
			});
			//给table”操作“添加行为
			$("table.data-table tbody tr td a.del-table").live("click", function () {
					if(confirm("确定删除?"))
					{
						var params = {};
						params[ACTIONS.METADATA.DELETE_TABLE.params.TABLE_ID] = this.id.split("_")[1];
						params[ACTIONS.METADATA.DELETE_TABLE.params.VERSION] = this.id.split("_")[2];
						$.util.Data.request({
								url: ACTIONS.METADATA.DELETE_TABLE.url,
								data: params,
								type: "post",
								success: function () {
									dataTable.table.updateData();
								}
							});
					}
				});
		</script>
		<style type="text/css">
			div {
				position: static;
			}
		</style>
	</head>
	<body>
		<div id="mainPage" class="surround-layout">
			<jsp:include page="/jsp/frame/top.jsp" flush="true"></jsp:include>
			<div class="middle">
				<!-- 右侧内容输出 -->
				<div class="right">
					<div class="right-all-content">
						<div class="content-line-wrap">
							<div class="content-line-left content-line">
								<h1 class="content-title">${dataSourceNameCN}</h1>
								<button onclick="javascript: location.href = '<%=path%>/web/toAddNewTableAction.action?dataSourceInfoId=${dataSourceInfoId}';" class="special fun-create" id="createEvent">新建表</button>
							</div>
							<div class="content-line-right content-line">
								<form onsubmit="search($('#searchValue').val());return false;">
									<input type="text" id="searchValue" class="shadow" name="searchCond"/>
									<input type="submit" id="searchButton" class="special table-search" value="搜索"/>
								</form>
							</div>
						</div>
						<div id="dataTable" class="right-content">
							读取列表中...
						</div>
					</div>
				</div>
				<!-- 右侧内容区 -->
			</div>
		</div>
	</body>
</html>